home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!news
- From: austern@isolde.mti.sgi.com (Matt Austern)
- Newsgroups: comp.object,comp.lang.c++,comp.lang.java
- Subject: Re: Java: What's the Big Deal?
- Date: 01 Apr 1996 19:44:41 GMT
- Organization: SGI
- Message-ID: <AUSTERN.96Apr1114441@isolde.mti.sgi.com>
- References: <4jk4ee$7ri@newsbf02.news.aol.com> <1996Apr1.155416.12816@schbbs.mot.com>
- <Dp757r.K5@aplcenmp.apl.jhu.edu>
- Reply-To: austern@mti.sgi.com
- NNTP-Posting-Host: isolde.mti.sgi.com
- In-reply-to: hall@aplcenmp.apl.jhu.edu's message of Mon, 1 Apr 1996 18:40:39 GMT
-
- In article <Dp757r.K5@aplcenmp.apl.jhu.edu> hall@aplcenmp.apl.jhu.edu (Marty Hall) writes:
-
- > >With Java's array, memory will be smashed into millions of small
- > >pieces.
- >
- > There are also plenty of arguments that GC decreases the average
- > overall fragmentation in real programs and that allocators in GC'd
- > systems will be faster. Just as I don't buy the above argument as
- > showing anything typical, I don't buy the "GC decreases fragmentation"
- > argument either. Perhaps, but I'm not sure very many people know
- > enough about the typical memory allocation/deallocation patterns in
- > "real" programs to be able to tell.
-
- This isn't really a GC versus non-GC issue, but one that deals more
- narrowly with Java. In most languages (C, C++, Ada, Eiffel, etc.),
- you can allocate objects that are referred to either by value or by
- reference. So, for example, you can create an array of 1000 complex
- numbers with the reasonable expectation that you'll get a single 16000
- byte memory block.
-
- Java doesn't give you that choice: every object of a user-defined type
- must be allocated on the heap. If you're dealing with lots of small
- objects, then you will have to do lots of little heap allocations and,
- unless you've got an unusually clever compiler, you probably will see
- memory fragmentation.
- --
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
-